package com.young.shop.api.configurations;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000116694531";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCtn9jCk8mmEo6FITjSTEn7qo3acTgYeyThtMtsHUhguSOdSbjCP5li5WYI6fVELPS70mbPpgoVNKBYCgBUHYMSz+72YLPEjWbD45h4W5DfX6VRYP952HAvVp9w9ORcv3QzFLp9YYxnUZ6a7F2bAtJx6fqEXyznqmHlncG6RzycBbplgBbzQt4CgXQYpQ+mW1dZ5Y4Pvho/6EpIuurEsenws3HEOo5Yymjg6Y5dr0zMlQxii6AALQPWFkmKRgS8DVBTPCGBrUAZOuH3WX22bGtfMIZrG0xsJntrOFhSvzAOLe+oMWjJ2Dr5V5/iPEMdEI8ECznCJUkztftAeJMoXxS5AgMBAAECggEADC/EDyRAax+yUTXbvycLqlZ2TnbT8SPzmsQN4zDK+78C+O9LwJamNYLUfputU3O0WdqSzNBitMpU1tkc3MqVgKSHqVNwSsOCCw3Wjdwfdw5HlEayp+LBPRFfb5ZA0SG/DjbOQC6wpC/eahFdIJw6GTTLGK91f20+IdfI2UJWxryimBdjMV0lCqfR2ilZVjzTq5GtqTH+ICpLxfaTLDH31n1GC5A9Lx7XggUVEqwZSro65w3pIjhugHSKoNz/uqfvAw6XKP/xo9hnGvMWx/syt0+PKpoGDu1xm9p45pmusOfr3EgEwuA+F7UNujOwK7Tp9FPeYoScMua3R9FO2WpYYQKBgQDTEpetq2IOLy9MBEQIDKyr1vCkcT3c/jcBvozPvgkNkf3kEZdwdiauW8IM9zjXbJ49XyP9wi4waunRhKwxzwTNXJZ9mUC7JnZJ7CHf7rbSp4lzgSn5XAQzIMR+VLimCo5L/67RTIUIhf5w9YZX3F8xn0hQG6y8Ho4bLjaROVBENwKBgQDSlLCTiNxyyUFuwkfnH1mG+1AdGrxhpPPYxplW+ehNbgHg6Cij7m+26RKheDTKegkxx7NPbKf34Iqu7ZRyxzVivcrqRmoldf5O13Mt3BRHGl1ApqYLxnpn1D4pLmkVOSB8sMDdOkOPgPmatWzFcWI/DLq/ccTBM0SxZ7TypRXWjwKBgQC6CdUu+bP/lI83jTr5bVJ0U4rfJgDE3DxXiUBLitAn6dnCP88fDMSjQbUUAINVPSNsLINoktJrUpCsXyf27uTorQbnxUBMtGXmWf6xhZIWshxwdhQs+XGqLuOCBeKKVxt82OuZBrzq+k99+KpknpQ5BI+ULBBf7v6J7n2iGsYomQKBgFLtrXAceLxXl4YXypsxVF98/vrHOaK2hDU9WMvQ1PQRO3on00Fjt+jvdp/SJ/AJCS/qdin0H13VtqfW9hwRaWu+VHfYTRr9ka3Y2QoZXn712f2I42FFw5S6F9S96zIpcirIrNsyg8KyxxlvEyvaUBeGWtDj69kt6IJ41eCstKHvAoGBALSwwz35y1Eqik7koWXlbI86cl4YjdfG3BBl3JNVMAHvsqieOxZGzxiYgYXPM7oKtMq0GSnTkL2Mdum39M/O5+EuDUCPDKPszsSIAsQXtZevaoakMXEVATtZL1GPZjDmSahTkliRT9sF+Yma/2R3rUdWf06pvpghRdcToeIVlJev";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhI5D0ARGQN1gErOaDI6ZDkfRQ0Kq5cRMXzaT50GJg116RgVKyNqYUgIpbmzy7OgS08UcCKf/mcEyMjqCdvsTPckHeZfzTYeICn6uHUjHSiJerD3fCB0bY+Prr/ZGA1RT027sf6CdpZZs8Srrc6lsYbesTirzpOLBoY2D4a0iNLD2ebozHa9nkSA9Fr9XmaqsYC4SfG7N5Obq0SCYYkNfCT64TnIME+gXrQGwX5xW4IP65NaP+GfbO87RDJrpOqLZUdibU224kMlVJHVwuADGXcGfEzZRwLkrt45hC5Sa6ktwAW83nB0ElNqqWd6yREYPlL1G2l6O7XrjPyk2dBdRXQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "https://xmqngroktest.ngrok2.xiaomiqiu.cn/shop-api/order/chang02";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8090/shop-api/order/chang";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
//    public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";

    // 支付宝网关沙箱
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
